import request from '@/utils/request'

// 获取列表
export const getPointListAPI = (params) => request.get('/vm-service/node/search', {
  params
})

// 获取区域列表
export const areaList = params => request.get('/vm-service/region/search', {
  params
})

// 获取商圈列表
export const businessList = () => request.get('/vm-service/businessType')

// 合作商点位
export const collaborateList = () => request.get('/vm-service/node/nodeCollect')

// 新增点位
export const CreatePonit = data => request.post('/vm-service/node', data)

// 获取城市列表
export const cityId = id => request.get(`/vm-service/region/${id}`)
// 修改列表
export const editList = data => request.put(`/vm-service/node/${data.id}`, data)

// 查看点位详情
export const detailList = id => request.get(`/vm-service/node/vmList/${id}`)

// 删除点位
export const delPoint = id => request.delete(`/vm-service/node/${id}`)

/**
 * 区域点位
 */
export const regionSearch = data => request.get('/vm-service/region/search', data)

// 搜索
export const searchArea = data => request.get('/vm-service/region/search', {
  params: data
})
// 新增区域
export const addArea = data => request.post('/vm-service/region', data)

// 搜索区域列表
export const PointareaList = data => request.get('/vm-service/region/search', {
  params: data
})

// 修改区域
export const editAreaList = data => request.put(`/vm-service/region/${data.id}`, data)

// 获取区域详情
export const detailAreaList = id => request.get(`/api/vm-service/region/${id}`)

// 删除区域详情
export const delArea = id => request.delete(`/vm-service/region/${id}`)

/**
 * 合作商搜索
 */
export const painner = data => request.get('/user-service/partner/search', {
  params: data
})

// 新增合作商
export const addPainner = data => request.post('/user-service/partner', data)

// 修改合作商
export const editPainner = data => request.put(`/user-service/partner/${data.id}`, data)

// 删除合作商
export const delPainner = id => request.delete(`/user-service/partner/${id}`)

// 重置合作商密码
export const resetPainner = id => request.put(`/user-service/partner/resetPwd/${id}`)
